package com.cloud.pole.util;

import com.cloud.pole.user.biz.CpChannelPersonBiz;
import com.cloud.pole.user.model.entity.BaseUser;
import com.cloud.pole.user.model.entity.CpChannelPerson;


public class ChannelPersonUtil {
	
    public static void checkChannelPerson(String mobile, BaseUser baseUser, CpChannelPersonBiz channelPersonBiz) {
    	CpChannelPerson channelPerson = channelPersonBiz.selectByMobile(mobile);
    	if(channelPerson != null){
			baseUser.setRealName(channelPerson.getSurname());
			baseUser.setIdcardNo(channelPerson.getIdcard());
			baseUser.setCityId(channelPerson.getCity());
			baseUser.setProvinceId(channelPerson.getProvince());
			baseUser.setCountryId(channelPerson.getCounty());
			baseUser.setChannelNetId(channelPerson.getOwnNetId());
			baseUser.setChannelPersonId(channelPerson.getId());
			baseUser.setMarketCode(channelPerson.getJobNumber());
			baseUser.setChannelType(channelPerson.getChannelType());
//			if(channelPerson.getChannelType().equals(2) || channelPerson.getChannelType().equals(4)){
//				baseUser.setChannelClass(1);
//			}
		}else{
			baseUser.setMarketCode("888" + mobile);
			baseUser.setChannelType(9);
//			baseUser.setChannelClass(2);
		}
    }
}
